<template>
  <div name="Department">
    <div class="s-dataCenter">
      <div class="s-dataItem">
        <DataCenterlist :data="queryNewCatalog" :title="'最新资源'" :moreUrl="'/aa'"></DataCenterlist>
      </div>
      <div class="s-dataItem">
        <DataCenterlist :data="queryApplyTop5List" :title="'热门资源'" />
      </div>
    </div>
  </div>
</template>
<script>
import DataCenterlist from "@/components/base/DataCenterlist";
export default {
  name: "DataCenter",
  components: {
    DataCenterlist,
  },
  data() {
    return {
      queryNewCatalog: [],
      queryApplyTop5List: [],
    };
  },
  mounted() {
    this.getNewCatalog();
    this.getQueryApplyTop5();
  },
  methods: {
    getNewCatalog() {
      this.$http
        .get("/iaiqsmde9fea569965ed56ab98ea0501752fe631902841e/queryNewCatalog")
        .then(res => {
          if (res.code == 0) {
            this.queryNewCatalog = res.data;
          }
        })
        .catch(err => {
          console.log(err.message || "数据异常");
        });
    },
    getQueryApplyTop5() {
      this.$http
        .get("/iaiqsmde9fea569965ed56ab98ea0501752fe631902841e/queryApplyTop5")
        .then(res => {
          if (res.code == 0) {
            this.queryApplyTop5List = res.data.top;
          }
        })
        .catch(err => {
          console.log(err.message || "数据异常");
        });
    },
  },
};
</script>
